<div ms-controller="customer" class="cus">
<div class="go-title">
                    <span>
                        <span style="color: #66a8bc;cursor: pointer" onclick=' window.location.href="#!/customer/0"'>客户供应商管理</span>
                        <!--<span ms-if='cusId!=0'>&nbsp;&RightAngleBracket;客户供应商详情</span>-->
                    </span>

</div>
<!--列表-->
<div >
    <!--<div class="box-row ">-->
        <!--<input type="number"  class="form-control" ms-duplex="cusId" style="width:300px" placeholder="输入客户编号快速查看"/>-->
        <!--<button ms-if='cusId!=""' ms-click="toInfo(cusId)" class="btn btn-default">搜索</button>-->
    <!--</div>-->
    <!--<br/>-->
    <!--列表开始-->
    <div class="box-row warp hor-aver row-same" style="margin-right:0px;margin-left: 0px">
        <!--新增块-->

        <div class="new-goods cus-block">
            <!--非编辑状态-->
            <div class="box-col row-center hor-center ver-center" ms-if="editing!=-1" ms-click="edit(-1)" style="width: 100%;padding:12px;color:#b9b9b9;cursor: pointer">
                        <i class="icon-plus icon-3x"></i>
                        <span>添加客户或供应商</span>
            </div>

            <!--编辑状态-->
            <div class="" ms-if="editing==-1"  style="width: 100%">

                <span class="">

                        <span class="c-type" ms-class="c-type-0:New.Type==0||New.Type==2" ms-click="editType(-1,0)">客</span>

                        <span class="c-type" ms-class="c-type-1:New.Type==1||New.Type==2" ms-click="editType(-1,1)">供</span>
                    </span>
                <h3 style="color: #eaeaea;margin-top: 5px">
                    <input type="text" maxlength="50" onkeyup="cutLength(this)" style="width: 100%" class=" cus-input-title" placeholder="输入客户供应商名称" ms-duplex="New.Name"/>

                </h3>
                <div class="box-row hor-ends warp">
                    <div style="margin-bottom: 8px" class="box-row">
                        联系方式：
                        <input type="text" maxlength="50" onkeyup="cutLength(this)" class="go-input-body" style="width: 200px" ms-duplex="New.Phone"/>
                    </div>
                    <div style="margin-bottom: 8px" class="box-row">
                        通讯地址：
                        <input type="text" maxlength="50" onkeyup="cutLength(this)" class="go-input-body" style="width: 200px" ms-duplex="New.Address"/>
                    </div>
                    <div style="margin-bottom: 8px" class="box-row">
                        期初应收：
                        <input type="number" class="go-input-body" style="width: 100px" ms-duplex="New.Receivables"/>
                    </div>
                    <div style="margin-bottom: 8px" class="box-row">
                        期初应付：
                        <input  type="number" class="go-input-body" style="width: 100px" ms-duplex="New.Payable"/>
                    </div>
                    <div >

                        <a class="btn btn-xs btn-success " ms-click="add"><i class=" icon-ok"></i>保存</a>
                        <a class="btn btn-xs btn-default" ms-click="editClose"><i class=" icon-remove"></i>取消</a>

                    </div>
                </div>



            </div>
        </div>

        <table  class="table table-bordered all-table">
            <thead>
            <tr>
                <td>操作</td>
                <td>客户编号</td>
                <td>客户类别</td>
                <td>名称</td>
                <td>联系方式</td>
                <td>通讯地址</td>
                <td>结款状态</td>
                <td>应收款</td>
                <td>应付款</td>
            </tr>
            </thead>
            <tbody>
            <tr ms-repeat="list" ms-class="type-1:el.Receivables!=0||el.Payable!=0">
                <td>
                    <a class="btn btn-xs btn-default" style="cursor: pointer" ms-click="toInfo(el.CustomerID,1)">
                    <i class="icon-pencil"></i>
                    &nbsp;编辑
                </a>
                    <a class="btn btn-xs btn-success" style="cursor: pointer" ms-click="toInfo(el.CustomerID)">
                        详情
                    </a>
                </td>
                <td>#{{el.CustomerID}}</td>
                <td>
                    <span class="c-type c-type-0" ms-if="el.Type==0||el.Type==2">客</span>
                    <span class=" c-type c-type-1" ms-if="el.Type==1||el.Type==2">供</span>
                </td>
                <td>
                    <a ms-click="toInfo(el.CustomerID)" style="cursor: pointer">{{el.Name}}</a>

                </td>
                <td>{{el.Phone}}</td>
                <td>{{el.Address}}</td>
                <td>
                    <span ms-visible="el.Receivables!=0||el.Payable!=0">记账</span>
                    <span ms-visible="el.Receivables==0&&el.Payable==0">已结清</span>
                </td>
                <td>{{Math.abs(el.Receivables)}}</td>
                <td>{{Math.abs(el.Payable)}}</td>
            </tr>
            </tbody>
        </table>



    </div>


    <a class="btn btn-block btn-default" ms-click="getCus" ms-visible="T>list.length">加载更多<small>(还有{{Math.round(T-list.length)}}条数据)</small></a>

    <div style="color:#bfbfbf" class="text-center">没有更多数据了……</div>

</div>

</div>
